<?php
/**
 * Obtiene informacion sobre las Font
 * 
 * Si necesitamos obtener informacion acerca de los fonts tenemos que implenetar
 * este ws.
 *
 */
class PapiWS_Service_Font 
{
	/**
	 * Retrieve list of active fonts.
	 *
	 * Retrieves a list of all active fonts in the system. The array
	 * contains a list of FontVO.
	 *
	 * @return Array LIsta de FontVO
	 */
	public function getAll()
	{
		// try to find result in cache first
		//$cacheId = 'background_all_background';
		//$res = Zend_Registry::get('cache')->load( $cacheId );
		///if (! $res ) {
			try {
	            $client = new Zend_XmlRpc_Client( 
	            	Zend_Registry::get('config')->webservices->drupal->url  
	            );
            	$res = $client->call(
            		'eserivces.view.get', array( 
            			'font_category_item'
            			, array()
            			, array(0)
            		)
            	);
			} catch ( Exception $e ) {
	            throw new Ext_Exception( $e );
	            return array();
	        }
			//Zend_Registry::get('cache')->save( $res, $cacheId );
		//}
		if( is_array( $res ) ) {
			require_once( APPLICATION_PATH  . "/papi/services/vo/FontVO.php" );
			$result = array();
			foreach( $res as $r ) {
				$result[] = new PapiWS_Model_FontVO( $r );
			}
			return $result;
		}
		return array();
	}
}
